<template>
  <div class="home">
    <img alt="Vue logo" src="../assets/logo.png" />
    <HelloWorld msg="Welcome to Your Vue.js App" />
  </div>
</template>

<script lang="ts">
// @ is an alias to /src
import HelloWorld from "@/components/HelloWorld.vue";
import Vue, { PropType } from "vue";
interface IObj {
  name: string;
  age: number;
}
export default Vue.extend({
  name: "HomeView",
  components: {
    HelloWorld,
  },
  props: {
    str: {
      type: String,
    },
    obj: {
      type: Object as PropType<IObj>,
    },
    fn: {
      type: Function as PropType<() => void>,
    },
  },
  data() {
    return {
      age: 13,
    };
  },
  methods: {
    getAge(age: string): number {
      return parseInt(age);
    },
  },
});
</script>
